package hxy.bytecode.element;

/**
 * @author eric
 * @program bytecode
 * @description
 * @date 8/22/20
 */
public class Int2 {


    public static void main(String[] args) {

        Int2 int2 = new Int2();
        int2.testInt();
        int2.testInteger();

        testStaticInteger();

    }

    public void testInt() {
        int a = 0;
        System.out.println(a);
        test(a);
        System.out.println(a);
        test1(a);
        System.out.println(a);
    }

    public void test(int i) {
        i++;
        System.out.printf("test方法里面的值是 %s\n", i);
    }

    public void test1(int i) {
        i++;
        System.out.printf("test1方法里面的值是 %s\n", i);

    }

    Integer a = new Integer(129);

    public void testInteger() {
        System.out.println(a);
        test2(a);
        System.out.println(a);
        test3(a);
        System.out.println(a);
    }

    public void test2(Integer i) {
        i = i;
        i = i + 1;
        System.out.printf("test2方法里面的值是 %s\n", i);
    }

    public void test3(Integer i) {
        i = i + 1;
        System.out.printf("test3方法里面的值是 %s\n", i);

    }

    static Integer staticA = 1;

    public static void testStaticInteger() {
        System.out.printf("testStaticInteger方法里面的值是 %s\n", staticA);
        test4(staticA);
        System.out.printf("testStaticInteger方法里面的值是 %s\n", staticA);
        test5(staticA);
        System.out.printf("testStaticInteger方法里面的值是 %s\n", staticA);

    }

    public static void test4(Integer i) {
        System.out.println("传输参数i的hashcode"+i.hashCode());
        i = i + 1;
        System.out.println("相加后参数i的hashcode"+i.hashCode());
        staticA++;
        System.out.printf("test4方法里面的值是 %s\n", i);
    }

    public static void test5(Integer i) {
        i = i + 1;
        System.out.printf("test5方法里面的值是 %s\n", i);

    }
}


